// https://v3.nuxtjs.org/api/configuration/nuxt.config
import AutoImport from 'unplugin-auto-import/vite'
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

const lifecycle = process.env.npm_lifecycle_event;

export default defineNuxtConfig({
	vite: {
		plugins: [
			AutoImport({
				resolvers: [ElementPlusResolver()]
			}),
			Components({
				dts: true,
				resolvers: [ElementPlusResolver()]
			}),
		],
	},
	css: ["~/assets/scss/index.scss"],
	build: {
		// transpile: lifecycle === "build" ? ["element-plus"] : [],
		transpile: ['element-plus'],
	},
})
